runOnStartup(async runtime => {
    runtime.addEventListener("tick", () => tick())
    runtime.getLayout("MainLevel").addEventListener("afterlayoutstart", () => init())
});
function tick() {
    if(runtime.layout.name!="MainLevel") return;
    duckMove.moveToPoint()
}
function init() {
}
export default class duckMove {
    static init() {
    }
    static moveToPoint() {
        for (let getDuckObject of runtime.objects.DuckObject.instances()) {
            for (let getPoint of runtime.objects.duckMoveto.instances()) {
                if (getPoint.instVars.id == getDuckObject.instVars.id) {
                    /**@type {IMoveToBehaviorInstance} */
                    const duckMovetoBehavior = getDuckObject.behaviors.MoveTo
                    duckMovetoBehavior.addEventListener("arrived", function () {
                        getDuckObject.destroy()
                    })
                    duckMovetoBehavior.moveToPosition(getPoint.x, getPoint.y, true)
                }
            }
        }
    }
}